<template>
  <div>
    <z-form
      ref="zFormRef"
      :schemas="getSchemas()"
      :formProps="{
        inline: false,
        labelPlacement,
        labelWidth: 'auto',
        showRequireMark: true,
      }"
      formActionJustifyContent="start"
    >
      <!-- <template #formAction="{ formActions }">
        <div @click="() => formActions.resetFields()"> sds</div>
      </template> -->
    </z-form>

    <hr />
    <n-button @click="submit">测试从外部调用form方法</n-button>
  </div>
</template>

<script lang="ts" setup>
import ZForm from "@components/Form/ZForm.vue";
import { getSchemas, labelPlacement } from "./data";
import { ref } from "vue";

const zFormRef = ref();

async function submit() {
  const values = await zFormRef.value.validate();
  console.log(values);
}
</script>
